package se.zust.edu.dubbohello2.controller;

import org.apache.dubbo.config.annotation.Reference;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import se.zust.edu.dubbohello2.dto.User;
import se.zust.edu.dubbohello2.service.HelloService;
@RestController
@RequestMapping("/hello")
public class HelloController {
    @Reference(version = "${hello.service.version}")
    HelloService helloService;
    @RequestMapping("/sayHello")
    public String sayHello(String name){
        User user=new User();
        user.setUserName(name);
        //调用远程方法
        return helloService.sayHello(user);
    }
}
